<template>
  <div class="container">
    <div class="dashboard">
      <div class="panel">
        <h2 class="panel-title"><i class="fas fa-running"></i> 运动列表</h2>
        <div class="sports-list">
          <div class="sport-card active" data-sport="squat">
            <div class="sport-icon"><i class="fas fa-walking"></i></div>
            <div class="sport-name">深蹲</div>
          </div>
          <div class="sport-card" data-sport="benchpress">
            <div class="sport-icon"><i class="fas fa-dumbbell"></i></div>
            <div class="sport-name">卧推</div>
          </div>
          <div class="sport-card" data-sport="running">
            <div class="sport-icon"><i class="fas fa-running"></i></div>
            <div class="sport-name">跑步</div>
          </div>
          <div class="sport-card" data-sport="deadlift">
            <div class="sport-icon"><i class="fas fa-weight-hanging"></i></div>
            <div class="sport-name">硬拉</div>
          </div>
          <div class="sport-card" data-sport="shoulderpress">
            <div class="sport-icon"><i class="fas fa-hand-paper"></i></div>
            <div class="sport-name">肩部推举</div>
          </div>
          <div class="sport-card" data-sport="rowing">
            <div class="sport-icon"><i class="fas fa-water"></i></div>
            <div class="sport-name">划船机</div>
          </div>
        </div>

        <div class="metrics">
          <div class="metric-card">
            <div class="metric-label">今日运动</div>
            <div class="metric-value">3</div>
            <div class="metric-label">项运动</div>
          </div>
          <div class="metric-card">
            <div class="metric-label">本周时长</div>
            <div class="metric-value">4.2</div>
            <div class="metric-label">小时</div>
          </div>
          <div class="metric-card">
            <div class="metric-label">累计卡路里</div>
            <div class="metric-value">1280</div>
            <div class="metric-label">千卡</div>
          </div>
          <div class="metric-card">
            <div class="metric-label">动作评分</div>
            <div class="metric-value">86</div>
            <div class="metric-label">分 (良好)</div>
          </div>
        </div>
      </div>

    </div>

  </div>
</template>
<script lang="js">
  export default {
    name: 'SportModel',
    components: {
    },
    data() {
      return {
        character: null,
        sportCards: null,
        barbell: null,
      }
    },
    mounted() {
      // 运动选择功能
      this.sportCards = document.querySelectorAll('.sport-card');
      this.sportCards.forEach((card) => {
        card.addEventListener('click', () => {
          // 移除所有active类
          this.sportCards.forEach(c => c.classList.remove('active'));
          // 添加active类到当前卡片
          card.classList.add('active');
          const sport = card.getAttribute('data-sport');
          this.$router.push({ path: `/sportmodel/detail/${sport}` });
        });
      });
    },
    methods: {

    }
  }
</script>
<style>
body {
  //background: linear-gradient(135deg, #1a2a6c, #2c3e50);
  color: #fff;
  min-height: 100vh;
}

.container {
}

header {
  text-align: center;
  padding: 30px 0;
  margin-bottom: 30px;
  position: relative;
}

h1 {
  font-size: 3.2rem;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  background: linear-gradient(to right, #00c9ff, #92fe9d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
}

h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(to right, #00c9ff, #92fe9d);
  border-radius: 2px;
}

.subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 25px;
  margin-bottom: 30px;
}

.panel {
  background: whitesmoke;
  border-radius: 20px;
  padding: 25px;
  //box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  //border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.panel-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #00c9ff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sports-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.sport-card {
  background: rgba(50, 70, 100, 0.6);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.sport-card:hover {
  transform: translateY(-5px);
  background: rgba(70, 100, 150, 0.7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: #00c9ff;
}

.sport-card.active {
  background: rgba(30, 150, 200, 0.7);
  border-color: #92fe9d;
}

.sport-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  color: #92fe9d;
}

.sport-name {
  font-size: 1.4rem;
  font-weight: 600;
}

.animation-section {
  height: 500px;
  display: flex;
  flex-direction: column;
}

.animation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.animation-container {
  flex: 1;
  background: rgba(20, 20, 40, 0.8);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gym-floor {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 20%;
  background: linear-gradient(to top, #222, #111);
  border-top: 2px solid #333;
}

.character {
  position: relative;
  width: 180px;
  height: 350px;
  transform-style: preserve-3d;
  transform: rotateY(-10deg);
}

.head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 80px;
  background: #f1c27d;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.body {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 150px;
  background: #3498db;
  border-radius: 40px 40px 10px 10px;
  z-index: 5;
}

.arm {
  position: absolute;
  width: 30px;
  background: #f1c27d;
  border-radius: 15px;
  transform-origin: top center;
}

.left-arm {
  top: 80px;
  left: 20px;
  height: 110px;
}

.right-arm {
  top: 80px;
  right: 20px;
  height: 110px;
}

.leg {
  position: absolute;
  width: 35px;
  background: #2980b9;
  border-radius: 10px 10px 5px 5px;
  transform-origin: top center;
}

.left-leg {
  top: 200px;
  left: 40px;
  height: 130px;
}

.right-leg {
  top: 200px;
  right: 40px;
  height: 130px;
}

.barbell {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 10px;
  background: linear-gradient(to right, #aaa, #ddd, #aaa);
  border-radius: 5px;
  z-index: 4;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.weight {
  position: absolute;
  width: 25px;
  height: 70px;
  background: linear-gradient(to right, #555, #333, #555);
  border-radius: 5px;
}

.left-weight {
  left: -30px;
}

.right-weight {
  right: -30px;
}

.analysis-section {
  margin-top: 30px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.metric-card {
  background: rgba(40, 60, 100, 0.6);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #92fe9d;
  margin: 10px 0;
}

.metric-label {
  font-size: 1.1rem;
  opacity: 0.8;
}

.ai-analysis {
  background: rgba(40, 60, 100, 0.6);
  border-radius: 15px;
  padding: 25px;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.ai-icon {
  font-size: 2.5rem;
  color: #00c9ff;
}

.analysis-content {
  background: rgba(30, 40, 70, 0.7);
  border-radius: 15px;
  padding: 20px;
  margin-top: 15px;
}

.feedback-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-item:last-child {
  border-bottom: none;
}

.feedback-icon {
  font-size: 1.5rem;
  color: #92fe9d;
  min-width: 30px;
}

.feedback-good .feedback-icon {
  color: #4CAF50;
}

.feedback-bad .feedback-icon {
  color: #f44336;
}

.feedback-text {
  flex: 1;
}

.feedback-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.suggestion {
  color: #92fe9d;
  font-style: italic;
  margin-top: 5px;
}

.controls {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.btn {
  padding: 12px 25px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(to right, #00c9ff, #92fe9d);
  color: #1a2a6c;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid #00c9ff;
  color: #00c9ff;
}

@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sports-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  h1 {
    font-size: 2.5rem;
  }

}

</style>
